<?php $id = getID();?>
<form method="post" action="<?php _actionUrl($this);?>" onsubmit="return ajax_form(this)">
<?php if( get('redirect') ): ?>
<input type="hidden" name="redirect" value="<?php _e(get('redirect'));?>"/>
<?php endif;?>
<?php $post = $this->get('post');?>
<input type="hidden" name="ID" value="<?php _e($post['ID']);?>"/>
<div class="x-form-container">
	<table width="100%" cellpadding="4" class="x-form">
		<tr>
			<td class="x-form-label" style="width:133px">Tiêu đề: </td>
			<td>
				<input class="x-text" type="text" name="title" value="<?php _e($post['title'])?>" style="width:300px;"/>
			</td>
		</tr>
		
			<tr>
				<td class="x-form-label">Loại giao dịch: </td>
				<td>
					<select name="parent_id" class="x-select">
					<?php foreach( $this->get('cats') as $a ):?>
					<option value="<?php _e($a['ID']);?>"<?php if($a['ID']==$post['parent_id']) _e(' selected')?>><?php _e($a['title']);?></option>
					<?php endforeach;?>
					</select>
				</td>
			</tr>

			<tr>
				<td class="x-form-label">Ngày:</td>
				<td>
					<input type="text" name="date" value="<?php _e(show_date(DATE_FORMAT,$post['date']))?>" onclick="date_picker(this,{format: 'd/m/Y' })" class="x-text x-date"/>
				</td>
			</tr>
		
			<tr>
				<td valign="top" class="x-form-label">Mô tả: </td>
				<td>
					<textarea class="x-text" name="desc" style="width:500px;height:100px"><?php _e($post['desc'])?></textarea>
				</td>
			</tr>
			
			<tr>
				<td></td>
				<td>
					<input type="submit" value="Cập nhật" class="x-button x-save"/>
					<a onclick="$(this).parent('.lightbox').remove()" class="x-button x-fresh">Hủy bỏ</a>
				</td>
			</tr>
	</table>
</div>
</form>